public class Main {
    public static void main(String[] args) {
        EagerSingleton eagerSingleton = EagerSingleton.getInstance();
        eagerSingleton.setMyName("张三");
        System.out.println(eagerSingleton.shoInfo());

        System.out.println(eagerSingleton.getMyName());
        System.out.println(eagerSingleton.shoInfo());

        // 懒汉单例
        LazySingleton lazySingleton = LazySingleton.getInstance();
        System.out.println(lazySingleton.shoInfo());
        System.out.println(lazySingleton.shoInfo());
    }
}
